/** 
 * @title: GridViewHomeAdapter.java 
 * @package com.sinoglobal.ningxia.adapter 
 * @description: myTask(用一句话描述该文件做什么) 
 * @author wx
 * @date 2015-3-11 下午4:16:59 
 */
package com.sinoglobal.ningxia.adapter;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.sinoglobal.ningxia.R;
import com.sinoglobal.ningxia.beans.HomeGridSortsVo;

/**
 * @title: GridViewHomeAdapter.java
 * @package com.sinoglobal.ningxia.adapter
 * @description: myTask(用一句话描述该文件做什么)
 * @author wx
 * @date 2015-3-11 下午4:16:59
 */
public class GridViewHomeAdapter extends AbBaseAdapter<HomeGridSortsVo> {

	List<HomeGridSortsVo> data;

	public GridViewHomeAdapter(Context context, int layoutId, List<HomeGridSortsVo> data) {
		super(context, layoutId, data);
		this.data = data;
	}

	@Override
	void setView(int position, View convertView) {
		ImageView iv=null;
		TextView tv=null;
		iv=ViewHolder.getViewById(convertView, R.id.iv);
		tv=ViewHolder.getViewById(convertView, R.id.tv);
        tv.setText(data.get(position).getName());
        iv.setImageResource(data.get(position).getImgResId());
	}
}
